<?php


	namespace app\home\validate;


	use think\Request;
	use think\Validate;

	class Base extends Validate
	{

		/**
		 * 场景验证
		 *
		 * @param $scene
		 *
		 * @return array|bool
		 *
		 * @param
		 *
		 * @throws
		 *
		 */
		public function goSceneCheck ($scene) {
			$request = Request::instance();
			if (!$this->scene($scene)->check($request->param())) {
				return $this->error;
			}

			return false;
		}


		protected function isInteger($value){
			return !is_numeric($value) || strpos($value,'.') !== false ? false : true;
		}


		protected function isMobile($value){
			$mobile = "/^1[345789]\d{9}$/";

			return !preg_match($mobile,$value) ? false : true;
		}




	}